package com.dl.mqtest.Listener;

import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

/**
 * @author DL
 * @create 2024-09-25 10:17
 */
@Service
@RocketMQMessageListener(topic = "test-topic", consumerGroup = "myConsumerGroup", consumeMode = ConsumeMode.ORDERLY)
public class MyRocketMqListener implements RocketMQListener<String> {
    @Override
    public void onMessage(String message) {
        System.out.println("Received message: " + message);
    }
}
